/* 全局样式 */
:root {
    --primary-color: #1a73e8;
    --primary-light: #e8f0fe;
    --primary-dark: #1765cc;
    --accent-color: #ea4335;
    --text-primary: #202124;
    --text-secondary: #5f6368;
    --text-tertiary: #80868b;
    --bg-color: #f8f9fa;
    --bg-color-dark: #f1f3f4;
    --border-color: #dadce0;
    --sidebar-width: 240px;
    --sidebar-collapsed-width: 64px;
    --header-height: 64px;
    --transition-speed: 0.3s;
    --shadow-1: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08);
    --shadow-2: 0 3px 6px rgba(0,0,0,0.15), 0 2px 4px rgba(0,0,0,0.12);
    --border-radius: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* 布局容器 */
.page-container {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏样式 */
.sidebar {
    width: var(--sidebar-width);
    background-color: white;
    box-shadow: var(--shadow-1);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: all var(--transition-speed) ease;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

/* 侧边栏标题区域 */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    padding-right: 0px;
    height: var(--header-height);
}

.logo-container {
    display: flex;
    align-items: center;
    overflow: hidden;
}

.logo-icon {
    font-size: 24px;
    color: var(--primary-color);
    margin-right: 12px;
    flex-shrink: 0;
}

.logo-text {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    transition: opacity var(--transition-speed) ease;
}

.sidebar.collapsed .logo-text {
    opacity: 0;
    width: 0;
}

.sidebar-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 0 16px;
}

/* 侧边栏切换按钮 */
.sidebar-toggle {
    width: 25px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background-color: var(--bg-color);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.sidebar-toggle:hover {
    background-color: var(--bg-color-dark);
    color: var(--text-primary);
}

.sidebar-toggle i {
    font-size: 14px;
    transition: transform 0.2s;
}

/* 侧边栏导航菜单 */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}

.sidebar-nav-list {
    padding: 0 8px;
}

.sidebar-nav-item {
    margin-bottom: 4px;
    border-radius: var(--border-radius);
    transition: background-color 0.2s;
}

.sidebar-nav-item:hover {
    background-color: var(--bg-color);
}

.sidebar-nav-item.active {
    background-color: var(--primary-light);
}

.sidebar-nav-item.active .sidebar-nav-link {
    color: var(--primary-color);
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--text-secondary);
    border-radius: var(--border-radius);
    transition: color 0.2s;
}

.nav-icon {
    font-size: 18px;
    margin-right: 16px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.nav-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity var(--transition-speed);
}

.sidebar.collapsed .nav-text {
    opacity: 0;
    width: 0;
}

/* 侧边栏页脚 */
.sidebar-footer {
    padding: 16px;
    color: var(--text-tertiary);
    font-size: 12px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    transition: opacity var(--transition-speed);
}

.sidebar.collapsed .sidebar-footer {
    opacity: 0;
}

/* 主内容区域 */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: margin var(--transition-speed) ease;
    min-height: 100vh;
    position: relative;
}

.main-content.expanded {
    margin-left: var(--sidebar-collapsed-width);
}

/* 顶部标题栏 */
.top-header {
    height: var(--header-height);
    background-color: white;
    box-shadow: var(--shadow-1);
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
}

/* 菜单切换按钮 */
.menu-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background-color: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    transition: background-color 0.2s;
}

.menu-toggle:hover {
    background-color: var(--bg-color);
    color: var(--text-primary);
}

.menu-toggle i {
    font-size: 20px;
}

.page-title h1 {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
}

/* 用户信息区域 */
.user-info {
    position: relative;
    display: flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background-color 0.2s;
}

.user-info:hover {
    background-color: var(--bg-color);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--primary-light);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.user-avatar i {
    font-size: 20px;
}

.username {
    margin-right: 8px;
    font-weight: 500;
}

/* 管理员标识 */
.admin-badge {
    display: inline-block;
    padding: 2px 8px;
    background-color: var(--accent-color);
    color: white;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    margin-left: 8px;
}

/* 用户菜单 */
.user-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 180px;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-2);
    padding: 8px 0;
    display: none;
    z-index: 60;
    margin-top: 4px;
}

.user-info.active .user-menu {
    display: block;
    animation: fadeIn 0.2s;
}

/* 登出按钮 */
.logout-button, .login-button {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    color: var(--text-secondary);
    transition: background-color 0.2s;
}

.logout-button i, .login-button i {
    margin-right: 8px;
}

.logout-button:hover, .login-button:hover {
    background-color: var(--bg-color);
    color: var(--accent-color);
}

/* 内容容器 */
.content-container {
    padding: 24px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }
    
    .sidebar.collapsed {
        transform: translateX(0);
        /* width: 280px; */
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .main-content.expanded {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .sidebar-toggle {
        display: none;
    }
    
    .logo-text {
        display: block;
        opacity: 1;
        width: auto;
    }
    
    .nav-text {
        opacity: 1;
        width: auto;
    }
    
    .sidebar-footer {
        display: block;
        opacity: 1;
    }
    
    .top-header {
        padding: 0 16px;
    }
    
    .user-avatar {
        margin-right: 8px;
    }
    
    .username {
        max-width: 80px;
    }
}

@media (max-width: 480px) {
    .user-info {
        padding: 8px 8px;
    }
    
    .username {
        display: none;
    }
    
    .content-container {
        padding: 6px;
    }
    
    .page-title h1 {
        font-size: 18px;
    }
    
    .sidebar {
        width: 260px;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 移动端侧边栏暗色背景遮罩 */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

@media (max-width: 768px) {
    .sidebar-backdrop.active {
        display: block;
    }
} 